package org.destiny.sticky;

import java.awt.Image;
import java.awt.Toolkit;
import java.io.InputStream;
import java.net.URL;

import javax.swing.ImageIcon;

public class ResourceUtil {
    static Toolkit toolkit = Toolkit.getDefaultToolkit();

    public static URL getImageURL(String name) {
        return ClassLoader.getSystemResource("resource/image/" + name);
    }
    public static InputStream getImageStream(String name) {
        return ClassLoader.getSystemResourceAsStream("resource/image/" + name);
    }
    public static Image getImage(String name){
        return toolkit.getImage(getImageURL(name));
    }
    
    public static ImageIcon getIcon(String name){
        return new ImageIcon(getImage(name));
    }
    
}
